import type {HttpRequestConfig} from "luch-request"
import CustomRequestInstance from "@/service/request/instance"

// 这里后续可以增加一些其他类型的请求实例, 比如: mock

// 默认请求
export const createRequest = (config: HttpRequestConfig) => {
    const customInstance = new CustomRequestInstance(config)

    return customInstance.instance
}

// 静默请求
export const createSilentRequest = (config: HttpRequestConfig) => {
    const customInstance = new CustomRequestInstance(config, {
        showError: false,
        showLoading: false
    })

    return customInstance.instance
}